﻿using RBOSS.Business.ShoppingCarts;

namespace RBOSS.Business.CustomerModule
{
    public class CustomerSingleton
    {
        private static ShoppingCart _shoppingCart;
        private static ICustomer _customer;
        

        protected CustomerSingleton()
        {

        }

        public static void ClearSession()
        {
            _shoppingCart = null;
            _customer = null;
        }

        public static IShoppingCart GetShoppingCart()
        {
            if (_shoppingCart == null)
            {
                _shoppingCart = new ShoppingCart();
            }
            return _shoppingCart;
        }

        public static ICustomer GetCustomer()
        {
            if (_customer == null)
            {
                _customer = new Customer();
            }
            return _customer;

        }
        
    }
}